<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>弹窗广告</title>
    <style>
        *{
            margin:0px;
            padding:0px;
        }
        .ad{
            position: fixed;
            bottom:0px;
            right:0px;
            display:none;
        }
        .ad img{
            width:300px;
            height:200px;
        }
        .ad>span{
            width:30px;
            height:20px;
            right:0;
            top:0;
            position:absolute;
        }
        .ad>span:hover{
            cursor:pointer;
        }
    </style>
</head>
<body>
    <div class="ad">
        <img src="imgs/广告.jpg" alt="">
        <span></span>
    </div>
    <script src="./js/jquery-1.12.4.js"></script>
    <script>
      $(function(){
          //1.监听span的点击事件
          $(".ad>span").click(function(){
              console.log("点击了")
              $('.ad').remove();
          })
          //2.执行广告动画
          $('.ad').stop().slideDown(1000).fadeOut(500).fadeIn(800)
      })
    </script>
</body>
</html>
